<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Ip_m extends CI_Model {

	const TBL = 'ip';

	/**
     * 构造函数
     *
     * @access public
     * @return void
     */
    public function __construct()
    {
       parent::__construct();
    }

	function get_city_by_ip_val($ip_val)
	{
		$this->db->where('start <=', $ip_val);
		$this->db->order_by("start", "desc");
		$this->db->limit(1);
		$query = $this->db->get(self::TBL);
		$row = $query->row_array();
		return $query->num_rows() ? $row['id'] : false;
	}

}

/* End of file users_mdl.php */
/* Location: ./application/models/users_mdl.php */